<#if MsgName?starts_with("CG") == true>
package net.message {

	import flash.utils.ByteArray;
	import flash.utils.IDataInput;
	
	import net.MessageType;
	
	
	/**
	 * 文件名：${MsgName}Message.as
	 * <p>
	 * 功能：${MsgComment}
	 * <p>
	 * 版本：1.0.0
	 * <p>
	 * 作者：Builderd by AppTools
	 * <p>
	 */
	public class ${MsgName}Message extends BaseMessage {

		public function ${MsgName}Message() {
			type = MessageType.${MsgName};
			super();
		}
		
		override public function writeMessage(data:IDataInput):void {
	<#if FieldBeanList?size!=0>
		<#list FieldBeanList as field>
			//写入${field.comment}
			body.write${field.type?cap_first}(${field_index + 1});
			
		</#list>
	</#if>
	<#if BeanBeanList?size!=0>
		<#list BeanBeanList as beanBean>
		<#if beanBean.list == "true">
			//写入list长度
			this.writeByte((byte)${beanBean.name}.size());
			//循环写入数据
			for(${beanBean.clazzShort} beanBean:${beanBean.name}){
				<#list beanBean.fieldsBean as field>
				//写入${field.comment}
				this.write${field.type?cap_first}(beanBean.get${field.name?cap_first}());
				
				</#list>
			}
		<#else>
		<#list beanBean.fieldsBean as field>
			//写入${field.comment}
			this.write${field.type?cap_first}(${beanBean.name}.get${field.name?cap_first}());
			
		</#list>
		</#if>
		
		</#list>
	</#if>
		}
	}
}
</#if>
<#if MsgName?starts_with("GC") == true>
package net.message {

	import flash.utils.ByteArray;
	import flash.utils.IDataInput;
	
	import net.MessageType;
	
	
	/**
	 * 文件名：${MsgName}Message.as
	 * <p>
	 * 功能：${MsgComment}
	 * <p>
	 * 版本：1.0.0
	 * <p>
	 * 作者：Builderd by AppTools
	 * <p>
	 */
	public class ${MsgName}Message extends BaseMessage {
	
<#if FieldBeanList?size!=0>
	<#list FieldBeanList as field>
		//写入${field.comment}
		public var ${field.name}:${field.type};
	</#list>
</#if>

		public function ${MsgName}Message() {
			super();
			type = MessageType.${MsgName};
			handler = new UserHandler();
		}
	
		override public function readMessage(data:IDataInput):void {
	<#if FieldBeanList?size!=0>
		<#list FieldBeanList as field>
			//写入${field.comment}
			${field.name} = read${field.type?cap_first}(data);
		</#list>
	</#if>
	<#if BeanBeanList?size!=0>
		<#list BeanBeanList as beanBean>
		<#if beanBean.list == "true">
			//写入list长度
			this.writeByte((byte)${beanBean.name}.size());
			//循环写入数据
			for(${beanBean.clazzShort} beanBean:${beanBean.name}){
				<#list beanBean.fieldsBean as field>
				//写入${field.comment}
				this.write${field.type?cap_first}(beanBean.get${field.name?cap_first}());
				
				</#list>
			}
		<#else>
		<#list beanBean.fieldsBean as field>
			//写入${field.comment}
			this.write${field.type?cap_first}(${beanBean.name}.get${field.name?cap_first}());
			
		</#list>
		</#if>
		
		</#list>
	</#if>
		}
	}
}
</#if>
